﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace xna_game_engine.source
{
    public class TalentWarStoutHearted : CTalentBase
    {
        //* Members *//
        Dictionary<int, int> mValues;

        //* Functions *//
        public TalentWarStoutHearted(BaseCharacter owner)
        {
            mName = "Stout Hearted";
            mRanks = 5;
            mCurRank = 0;
            mValues = new Dictionary<int,int>();
            mValues[0] = 0;
            mValues[1] = 1;
            mValues[2] = 3;
            mValues[3] = 5;
            mValues[4] = 7;
            mValues[5] = 10;
            mDescription = String.Format("Increases the Warrior's health by {0}%", 0);
            mOwner = owner;
        }

        override public bool AddPoint()
        {
            if (mCurRank < mRanks)
            {
                mOwner.CurHealth = mOwner.CurHealth / (1.0f + (mValues[mCurRank] / 100.0f));
                mOwner.MaxHealth = mOwner.MaxHealth / (1.0f + (mValues[mCurRank] / 100.0f));
                mCurRank++;
                mDescription = String.Format("Increases the Warrior's health by {0}%", mValues[mCurRank]);
                mOwner.CurHealth = mOwner.CurHealth * (1.0f + (mValues[mCurRank] / 100.0f));
                mOwner.MaxHealth = mOwner.MaxHealth * (1.0f + (mValues[mCurRank] / 100.0f));
                return true;
            }
            else
            {
                return false;
            }
        }

        override public bool RemovePoint()
        {
            return true;
        }
    }
}
